package cn._2dland.http.method;

import java.util.Map.Entry;

public class GetMethod extends HttpMethod {
	public GetMethod(String url) {
		super(url);
	}

	public String getMethodName() {
		return "GET";
	}

	@Override
	protected String getQueryString() {
		if(parameters == null || parameters.size() <= 0)
			return null;

		StringBuffer buf = new StringBuffer();
		String sep = "";

		for(Entry<String, String> entry : parameters.entrySet()) {
			buf.append(sep).append(entry.getKey()).append("=").append(entry.getValue());

			sep = "&";
		}

		return buf.toString();
	}
}
